package com.kdtech.analyse.tool;

public class ParseLogic {

	/**
	 *  Jsoup select 选择器
	 */
	private String select;
	
	/**
	 *  取选择器选择后的什么类型  text 表示格式化后的文本，html 表示不格式化取全部html代码,attr 表示取某个属性
	 */
	private SelectType type=SelectType.text;
	
	/**
	 *  去选择器选择后，需要提取的属性名称
	 */
	private String attrName;
	
	/**
	 *  是否需要有Substring逻辑
	 */
	private SubstrLogic subLogic= null;
	
	
	public SubstrLogic getSubLogic() {
		return subLogic;
	}

	public void setSubLogic(SubstrLogic subLogic) {
		this.subLogic = subLogic;
	}

	/**
	 * select选择器，默认取选择得到的Elements的.text()
	 * @param select
	 */
	public ParseLogic(String select){
		this.select=select;
	}
	/**
	 * select选择器，默认取选择得到的Elements的.text(),并加入引用截取字符串的逻辑
	 * @param select
	 * @param subLogic
	 */
	public ParseLogic(String select,SubstrLogic subLogic){
		this.select=select;
		this.subLogic=subLogic;
	}
	
	
	/**
	 * select选择器，根据SelectType取Elements的属性 text/html
	 * @param select
	 * @param type
	 */
	public ParseLogic(String select,SelectType type){
		this.type=type;
	}
	/**select选择器，根据SelectType取Elements的属性 text/html,并加入引用截取字符串的逻辑
	 * @param select
	 * @param type
	 * @param subLogic
	 */
	public ParseLogic(String select,SelectType type,SubstrLogic subLogic){
		this.type=type;
		this.subLogic=subLogic;
	}
	
	/**select选择器，根据SelectType取Elements的属性 attrName
	 * @param select
	 * @param type
	 * @param attrName
	 */
	public ParseLogic(String select,SelectType type,String attrName){
		this.select=select;
		this.type=type;
		this.attrName=attrName;
	}
	/**
	 * *select选择器，根据SelectType取Elements的属性 attrName,并加入引用截取字符串的逻辑
	 * @param select
	 * @param type
	 * @param attrName
	 * @param subLogic
	 */
	public ParseLogic(String select,SelectType type,String attrName,SubstrLogic subLogic){
		this.select=select;
		this.type=type;
		this.attrName=attrName;
		this.subLogic=subLogic;
	}

	public String getSelect() {
		return select;
	}

	public void setSelect(String select) {
		this.select = select;
	}

	public SelectType getType() {
		return type;
	}

	public void setType(SelectType type) {
		this.type = type;
	}

	public String getAttrName() {
		return attrName;
	}

	public void setAttrName(String attrName) {
		this.attrName = attrName;
	}
	
	
	
}
